package model

import (
	"context"
	"time"
)

type EmployeeService interface {
	Get(ctx context.Context, id int64) (*Employee, error)
	Delete(ctx context.Context, id int64) error
	Create(ctx context.Context, e *Employee) error
	GetAllEmployeeIds(ctx context.Context, offset, limit int64) ([]int64, error)
	GetName(ctx context.Context, id int64) (string, error)
	GetAddress(ctx context.Context, id int64) (string, error)
	UpdateByID(ctx context.Context, e *Employee) error
	SetClassification(ctx context.Context, p *PaymentClassification) error
	SetSchedule(ctx context.Context, p *PaymentSchedule) error
	SetMethod(ctx context.Context, p *PaymentMethod) error
	GetClassification(ctx context.Context, id int64) (*PaymentClassification, error)
	GetSchedule(ctx context.Context, id int64) (*PaymentSchedule, error)
	GetMethod(ctx context.Context, id int64) (*PaymentMethod, error)
	SetName(ctx context.Context, id int64, name string) error
	SetAddress(ctx context.Context, id int64, address string) error
	// IsPayDate(ctx context.Context, dateTime time.Time) bool
	// GetPayPeriodStartDate(ctx context.Context, dateTime time.Time) time.Time
	// Paycheck(ctx context.Context, p *Paycheck) error
}

type EmployeeRespository interface {
	FindByID(ctx context.Context, id int64) (*Employee, error)
	Create(ctx context.Context, e *Employee) error
	UpdateByID(ctx context.Context, e *Employee) error
	DeleteByID(ctx context.Context, id int64) error
	GetEmployeeList(ctx context.Context, offset, limit int64) ([]*Employee, error)
	SetClassification(ctx context.Context, p *PaymentClassification) error
	SetSchedule(ctx context.Context, p *PaymentSchedule) error
	SetMethod(ctx context.Context, p *PaymentMethod) error
	GetClassification(ctx context.Context, id int64) (*PaymentClassification, error)
	GetSchedule(ctx context.Context, id int64) (*PaymentSchedule, error)
	GetMethod(ctx context.Context, id int64) (*PaymentMethod, error)
}

type PaycheckService interface {
	Create(ctx context.Context, p *Paycheck) error
	Get(ctx context.Context, id int64) (*Paycheck, error)
	Update(ctx context.Context, p *Paycheck) error
	SetGrossPay(ctx context.Context, id int64, grossPay float64) error
	SetDeductions(ctx context.Context, id int64, deduction float64) error
	SetNetPay(ctx context.Context, id int64, netPay float64) error
	GetPayPeriodEndDate(ctx context.Context, id int64) (time.Time, error)
	GetPayPeriodStartDate(ctx context.Context, id int64) (time.Time, error)
	GetGrossPay(ctx context.Context, id int64) (float64, error)
	GetDeductions(ctx context.Context, id int64) (float64, error)
	GetNetPay(ctx context.Context, id int64) (float64, error)
}

type PaycheckRepository interface {
	Create(ctx context.Context, p *Paycheck) error
	Update(ctx context.Context, p *Paycheck) error
	FindByID(ctx context.Context, id int64) (*Paycheck, error)
}

type PaymentClassificationService interface {
	Create(ctx context.Context, p *PaymentClassification) error
}

type PaymentClassificationRepository interface {
	Create(ctx context.Context, p *PaymentClassification) error
	FindByEmlpoyeeID(ctx context.Context, id int64) (*PaymentClassification, error)
}

type PaymentMethodService interface {
	Create(ctx context.Context, p *PaymentMethod) error
}

type PaymentMethodRepository interface {
	Create(ctx context.Context, p *PaymentMethod) error
	FindByEmlpoyeeID(ctx context.Context, id int64) (*PaymentMethod, error)
}

type PaymentScheduleService interface {
	Create(ctx context.Context, p *PaymentSchedule) error
}

type PaymentScheduleRepository interface {
	Create(ctx context.Context, p *PaymentSchedule) error
	FindByEmlpoyeeID(ctx context.Context, id int64) (*PaymentSchedule, error)
}

// Add Employee Transactions
type AddEmployeeTransActionRepository interface {
	Create(ctx context.Context, p *Employee) error
}

type AddEmployeeTransActionService interface {
	Create(ctx context.Context, p *Employee) error
}

// Add Commission Employee Transaction
type AddCommissionedEmployeeTransactionRepository interface {
	Create(ctx context.Context, p *Employee, c *CommissionedClassification) error
}

type AddCommissionedEmployeeTransactionService interface {
	Create(ctx context.Context, p *Employee, c *CommissionedClassification) error
}

// Add Hourly Employee Transaction
type AddHourlyEmployeeTransactionRepository interface {
	Create(ctx context.Context, p *Employee, h *HourClassification) error
}

type AddHourlyEmployeeTransactionService interface {
	Create(ctx context.Context, p *Employee, h *HourClassification) error
}

// Add Salary Employee Transaction
type AddSalaryEmployeeTransactionRepository interface {
	Create(ctx context.Context, p *Employee, s *SalariedClassification) error
}

type AddSalaryEmployeeTransactionService interface {
	Create(ctx context.Context, p *Employee, s *SalariedClassification) error
}

// Commissioned
type CommissionedClassificationRepository interface {
	Update(ctx context.Context, c *CommissionedClassification) error
}

type CommissionedClassificationService interface {
	Update(ctx context.Context, id int64, c *CommissionedClassification) error
}

// Change Hourly Transaction
type ChangeHourlyTransactionRepository interface {
	Update(ctx context.Context, h *HourClassification) error
}

type ChangeHourlyTransactionService interface {
	Update(ctx context.Context, id int64, h *HourClassification) error
}

// Change Salaried Classification Transaction
type ChangeSalariedTransactionRepository interface {
	Update(ctx context.Context, s *SalariedClassification) error
}

type ChangeSalariedTransactionService interface {
	Update(ctx context.Context, id int64, s *SalariedClassification) error
}

// About Mail Method interface
type MailMethodService interface {
	Create(ctx context.Context, id int64, m *MailMethod) error
	Update(ctx context.Context, id int64, m *MailMethod) error
}

type MailMethodRepository interface {
	Create(ctx context.Context, m *MailMethod) error
	Update(ctx context.Context, m *MailMethod) error
}

// About Hold Method interface
type HoldMethodService interface {
	Create(ctx context.Context, id int64, h *HoldMethod) error
	Update(ctx context.Context, id int64, h *HoldMethod) error
}

type HoldMethodRepository interface {
	Create(ctx context.Context, h *HoldMethod) error
	Update(ctx context.Context, h *HoldMethod) error
}

// About Direct Method interface
type DirectMethodService interface {
	Create(ctx context.Context, id int64, d *DirectMethod) error
	Update(ctx context.Context, id int64, d *DirectMethod) error
}

type DirectMethodRepository interface {
	Create(ctx context.Context, d *DirectMethod) error
	Update(ctx context.Context, d *DirectMethod) error
}

// Time Card interface
type TimeCardRepository interface {
	Create(ctx context.Context, t *TimeCard) error
	GetDate(ctx context.Context, id int64) (time.Time, error)
	GetHours(ctx context.Context, id int64) (float64, error)
}

// Sale Receipt Charge interface
type SaleReceiptChargeRepository interface {
	Create(ctx context.Context, s *SaleReceipt) error
	GetAmount(ctx context.Context, id int64) (float64, error)
	GetSaleDate(ctx context.Context, id int64) (time.Time, error)
}

type SaleReceiptTransactionService interface {
	Create(ctx context.Context, id int64, s *SaleReceipt) error
}
